//
//  YYJ_BaseImageView.m
//  ANDA_Club
//
//  Created by Lonely丶晏袁杰 on 2020/8/12.
//  Copyright © 2020 Lonely`yyj. All rights reserved.
//

#import "YYJ_BaseImageView.h"

@implementation YYJ_BaseImageView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(void)layoutSubviews{
    [super layoutSubviews];
    if (self.isRound) {
        self.layer.cornerRadius = CGRectGetWidth(self.frame)/2.0f;
    }else{
        self.layer.cornerRadius = self.cornerRadius;
    }
}
-(void)setIsRound:(BOOL)isRound{
    _isRound = isRound;
    [self layoutSubviews];
}
-(void)setCornerRadius:(CGFloat)cornerRadius{
    _cornerRadius = cornerRadius;
    [self layoutSubviews];
}
-(void)setBorderWidth:(CGFloat)borderWidth{
    _borderWidth = borderWidth;
    self.layer.borderWidth = borderWidth;
}
-(void)setBorderColor:(UIColor *)borderColor{
    _borderColor = borderColor;
    self.layer.borderColor = borderColor.CGColor;
}
@end
